import { createApp } from 'vue'

import App from './App.vue'
import router from './router'
import pinia from './stores'

import initMicroApp from './core/micro-app/index'
import initEventCenter from './core/events/index'
import installIcons from './core/plugins/install-icons'

import './assets/main.css'

import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

console.log('---[main]---', process.env.NODE_ENV, import.meta.env.DEV)

const app = createApp(App)

app.use(pinia)
app.use(router)
app.use(ElementPlus)

// 挂载icons-vue图标
installIcons(app)

app.mount('#app')

// 初始化 micro app
initMicroApp()
// 事件中心
initEventCenter()

console.log('---[is base app]---', window.__MICRO_APP_BASE_APPLICATION__)
